﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

public partial class OldTruck_send : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (Page.IsValid == true)
        {
            SqlConnection strcon = Class1.DBconnection();
            strcon.Open();
            string TruckName=this.TruckName.Text.ToString();
            string Type=this.Type.Text.ToString();
            string TruckSize=this.TruckSize.Text.ToString();
            string StartDate=this.StartDate.Text.ToString();
            string RideNumber=this.RideNumber.Text.ToString();
            string TruckLicense=this.TruckLicense.Text.ToString();
            string MaxWeight=this.MaxWeight.Text.ToString();
            string EffectDate=this.EffectDate.Text.ToString();
            string Color=this.Color.Text.ToString();
            string TruckNumber=this.TruckNumber.Text.ToString();
            string Area=this.Area.Text.ToString();
            string TruckManage=this.TruckManage.Text.ToString();
            string Price=this.Price.Text.ToString();
            string Old=this.Old.Text.ToString();
            string Linkman=this.Linkman.Text.ToString();
            string Tel=this.Tel.Text.ToString();
            string Bewrite = this.Bewrite.Text.ToString();
            string Username = Session["username"].ToString();
            string SendNow = Convert.ToString(DateTime.Now);
            Response.Write(SendNow);
            SqlCommand cmd = new SqlCommand("insert into tb_OldTruck (TruckName,Type,TruckSize,StartDate,RideNumber,TruckLicense,MaxWeight,EffectDate,Color,TruckNumber,Area,TruckManage,Price,Old,Linkman,Tel,Bewrite,SendNow,username)values('" + TruckName + "','" + Type + "','" + TruckSize + "','" + StartDate + "','" + RideNumber + "','" + TruckLicense + "','" + MaxWeight + "','" + EffectDate + "','" + Color + "','" + TruckNumber + "','" + Area + "','" + TruckManage + "','" + Price + "','" + Old + "','" + Linkman + "','" + Tel + "','" + Bewrite + "','" + SendNow + "','"+Username+"')", strcon);
            cmd.ExecuteNonQuery();
            strcon.Close();
            Response.Write("<script language=javascript>alert('恭喜您，添加成功！等待审核！')</script>");
        }
    }
}
